package net.dataforte.tooonebee.spring;

import static net.dataforte.tooonebee.Menu.menu;

import java.util.Set;

import javax.servlet.ServletConfig;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

import net.dataforte.tooonebee.Menu;
import net.dataforte.tooonebee.ServiceIntrospector;

public class SpringIntrospector extends ServiceIntrospector {
	
	@Override
	public void init(ServletConfig config) {
		super.init(config);
		WebApplicationContext webApplicationContext = WebApplicationContextUtils.getWebApplicationContext(config.getServletContext());
	}

	@Override
	public String getRequestPath() {
		return "spring";
	}
	
	@Override
	public Set<Menu> getMenuEntries() {
		Set<Menu> entries = super.getMenuEntries();
		entries.add(
			menu("Spring", this.getRequestPath())
		);
		return entries;
	}

	@Override
	public void handleRequest(HttpServlet servlet, HttpServletRequest req, HttpServletResponse res) throws Exception {
		

	}

}
